package com.oops.support;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class MySqlOperator {
    public static final String url = "jdbc:mysql://127.0.0.1:3311/lg? useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai";
    public static final String name = "com.mysql.cj.jdbc.Driver";
    public static final String user = "root";
    public static final String password = "141535";

    public static Connection conn = null;

    public static Connection getConnection(){
        try {
            Class.forName(name);
            conn=DriverManager.getConnection(url,user,password);
        } catch (ClassNotFoundException | SQLException e) {
            e.printStackTrace();
        }

        return conn;
    }

}
